from django.db import models

# Create your models here.

GENDER_CHOICES = (('M', "Male"), ('F', "Female"), ('T', "Transgender"))


class User(models.Model):
    username = models.CharField(max_length=128, verbose_name="Username")
    balance = models.DecimalField(
        max_digits=10, decimal_places=2, default=0, blank=True,
        verbose_name="Balance")
    gender = models.CharField(
        max_length=1, choices=GENDER_CHOICES, verbose_name="Gender", default='M')
    password = models.CharField(max_length=128, verbose_name="Password")
    nikname = models.CharField(max_length=256, blank= True, default="")

    def __str__(self):
        return self.nikname if self.nikname else self.username